package com.vueperson.vueperson.t1.CreationalPattern.PrototypePattern.OA;

public class Client {
    public static void main(String[] args) {
        WeeklyLog log_previous,log_new;

        Attachment attachment=new Attachment("附件1");     //创建附件对象
       /* log_previous.setAttachment(attachment);     //把附件添加到周报中*/
        log_previous =new WeeklyLog(attachment,"周报1","1月","容器1");              //创建原型对象
        log_new=log_previous.clone();               //调用克隆方法创建对象

        //比较周报
        System.out.println("周报是否相同?"+(log_previous==log_new));

        //比较附件
        System.out.println("附件是否相同?"+(log_previous.getAttachment()==log_new.getAttachment()));

        System.out.println(log_previous);
        System.out.println(log_new);

    }
}
